<%--
  Created by IntelliJ IDEA.
  User: 王辉
  Date: 2022/5/9
  Time: 23:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户注册</title>
</head>
<body>
<div align="center">
    <form action="registering.jsp" method="post">
        <br><br><br>
        <h1>用户注册</h1><br><br><br>
        用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:<input type="text" name="username" value="${request.uname}"><br><br>
        密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码:<input type="password" id="password" name="password" placeholder="不少于6位的高强度密码"><br><br>
        再次输入密码:<input type="password" id="rePassword" name="rePassword" onblur="validate()"><br><br>
        <input type="submit" value="注册">&nbsp;&nbsp;&nbsp;
        <input type="reset" value="重置">
    </form><br><br><br>
    已有账号？请点击 &nbsp;&nbsp;&nbsp;<a href="login.jsp" style="color: red">登录</a>
</div>
</body>
</html>
<script type="text/javascript">
    function validate(){
        var n1 = document.getElementById("password");
        var n2 = document.getElementById("rePassword");
        if (n1.value != "" && n2.value != "") {
            if (n1.value == n2.value) {
                return true;
            }
        }
        alert("两次密码输入不同,请重新输入!");
        return false;
    }

</script>